package com.hq.ims.data.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;
import com.hq.ims.data.vo.SmsTemplateMapstruct;
import com.hq.mybatis.base.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.ibatis.type.Alias;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author 蒋柏平
 * @since 20241011
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Alias("SmsTemplate")
@TableName(value = "sms_template")
@ApiModel(value = "短信模板配置", description = "短信模板配置")
public class SmsTemplate extends BaseModel<SmsTemplate> implements Serializable {

    @ApiModelProperty(value = "主键")
    @TableId(value = "sms_code", type = IdType.ASSIGN_UUID)
    private String smsCode;

    @ApiModelProperty(value = "短信标题")
    @TableField(value = "sms_title")
    private String smsTitle;

    @ApiModelProperty(value = "短信内容")
    @TableField(value = "sms_context")
    private String smsContext;

    @ApiModelProperty(value = "创建时间 - 不需程序员处理")
    @TableField(value = "create_date_time", fill = FieldFill.INSERT)
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createDateTime;

    @ApiModelProperty(value = "更新时间 - 不需程序员处理")
    @TableField(value = "update_date_time", fill = FieldFill.INSERT_UPDATE)
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateDateTime;

    @ApiModelProperty(value = "创建用户名称")
    @TableField(value = "create_user_name", fill = FieldFill.INSERT)
    private String createUserName;

    @ApiModelProperty(value = "更新用户名")
    @TableField(value = "update_user_name", fill = FieldFill.INSERT_UPDATE)
    private String updateUserName;


    public SmsTemplateMapstruct.SmsTemplateRowAuthVo auth() {
        SmsTemplateMapstruct.SmsTemplateRowAuthVo auth = new SmsTemplateMapstruct.SmsTemplateRowAuthVo(this);
        return auth;
    }

}
